package org.example.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.example.pojo.DRepair;
import org.example.pojo.DRepairman;
import org.example.pojo.select.DRepairSelect;
import org.example.service.DRepairService;
import org.example.service.DRepairmanService;
import org.example.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("repairman")
@Tag(name = "(未投入API)DRepairmanController",description = "")
public class DRepairmanController {

    @Autowired
    private DRepairmanService dRepairmanService;

    @PostMapping("/selectAll")
    public Result<Map> SelectAll(@RequestBody DRepairman dRepairman){
        return dRepairmanService.SelectAllRepairmans(dRepairman);
    }

    @PostMapping("/selectOne")
    public Result<DRepairman> SelectOne(@RequestBody DRepairman dRepairman){
        return dRepairmanService.SelectOneRepairman(dRepairman);
    }

    @PostMapping("/updateById")
    public Result<DRepairman> UpdateById(@RequestBody DRepairman dRepairman){
        return dRepairmanService.UpdateRepairmanById(dRepairman);
    }

    @PostMapping("/selectByType")
    public Result<List<DRepairman>> SelectByType(@RequestBody DRepairman dRepairman){
        return dRepairmanService.SelectByType(dRepairman);
    }

    @PostMapping("/addRepairman")
    public Result<List<DRepairman>> AddRepairman(@RequestBody DRepairman dRepairman){
        return dRepairmanService.AddRepairman(dRepairman);
    }

    @PostMapping("/deleteRepairman")
    public Result<DRepairman> DeleteRepairman(@RequestBody DRepairman dRepairman){
        return dRepairmanService.DeleteRepairman(dRepairman);
    }


}
